package IC.AST.nodes;

import java.util.List;
import IC.AST.*;

/**
 * class fields declaration
 */
public class FieldsDecl extends ASTNode {
	private TypeDecl type;	// the type of the declared fields
	private List<String> IDs;	// the identifiers

	/**
	 * @param type the type of the declared fields
	 * @param IDs the identifiers
	 * @param fileName TODO
	 * @param line the node line number
	 * @param column the node column number
	 */
	public FieldsDecl(TypeDecl type, List<String> IDs, String fileName, int line, int column) {
		super(fileName,line, column);
		this.type = type;
		this.IDs = IDs;
	}

	/**
	 * @return the type of the declared fields
	 */
	public TypeDecl getType() {
		return this.type;
	}

	/**
	 * @return the identifiers
	 */
	public List<String> getIDs() {
		return this.IDs;
	}

	public <D,U> U accept(PropogatingVisitor<D,U> v, D context) throws Exception {
		return v.visit(this,context);
	}
}
